]> sipb.mit.edu Git - snippets/.git/blob - sipbmp3-itunes/Send to sipbmp3.applescript
BarnOwl perl/external zcrypt binary reimplementation
[snippets/.git] / sipbmp3-itunes / Send to sipbmp3.applescript
1 -- -----------------
2 -- iTunes -> sipbmp3
3 -- -----------------
4 -- This is a simple little script which sends
5 -- music from an iTunes library to the sipbmp3
6 -- lpr server.
7 --
8 -- Changelog:
9 --
10 -- 9 Jan 2009 -> price added 'quoted form'
11 -- 7 Jan 2009 -> kmill created initial version
12 --
13 -- Installation:
14 --
15 -- 1) Launch the Printer Setup Utility and add
16 --    an IP Printer with the LPD protocol with
17 --    the following information:
18 --     Address: zygorthian-space-raiders.mit.edu
19 --     Queue: sipbmp3
20 --    It is not necessary to specify the driver.
21 --
22 -- 2) Create the directory ~/Library/iTunes/Scripts
23 --    and place the "Send to sipbmp3.scpt" file
24 --    within.
25 --
26 -- Usage:
27 --
28 -- When in iTunes, select the songs which you
29 -- would like to hear in the office, and click
30 -- "Send to sipbmp3" in the script menu from
31 -- the menu bar.  The script menu looks like a
32 -- little scroll icon.  There will be no
33 -- feedback beyond the pleasant sounds you now
34 -- hear around you.
35
36 set lista to {}
37
38 tell application "iTunes"
39         repeat with t in selection
40                 if class of t is (file track) then
41                         set loc to POSIX path of (get location of t)
42                         set end of lista to "lpr -o raw -Psipbmp3 " & (quoted form of loc)
43                 end if
44         end repeat
45 end tell
46
47 repeat with com in lista
48         do shell script com
49 end repeat